{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "52b727ec-6dcf-4118-8147-1652e79c86b4",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/ugly-number\n",
    "\n",
    "\n",
    "Runtime: 7896 ms, faster than 5.84% of Python3 online submissions for Ugly Number.\n",
    "Memory Usage: 14.4 MB, less than 10.99% of Python3 online submissions for Ugly Number.\n",
    "\n",
    "\n",
    "```python\n",
    "class Solution:\n",
    "    def isUgly(self, n: int) -> bool:\n",
    "        #6:27\n",
    "        def divition(n):\n",
    "            #print(n)\n",
    "            if n == 0:\n",
    "                return False\n",
    "            if int(n) - n != 0:\n",
    "                return False\n",
    "            if n in [1,2,3,5]:\n",
    "                return True\n",
    "            else:\n",
    "                return any([divition(n/2), divition(n/3), divition(n/5)])\n",
    "        return divition(n)\n",
    "        #6:38\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "81966a21-8c40-4862-b594-e2ecf859211d",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
